<template>
  <div >
    <div class="header">
      <div class="header-box">
        <div class="header-l">
          <van-icon name="arrow-left" />
          <span @click="backTo">返回</span>
        </div>

        <h2 class="header-m">意见反馈</h2>
        <div></div>
      </div>
    </div>
    <!-- 留言 -->
    <div class="top">
      <p>留言</p>
      <input v-model="text" class="txt-t" type="text" />
    </div>
    <!-- 电话 -->
    <div class="top">
      <p>电话</p>

      <input v-model="tel" class="txt-b" type="text" />
    </div>
    <button class="btn" @click="submit">提交</button>
  </div>
</template>

<script>
import {submitAction} from '@/api/user'
import { Toast } from 'vant';
export default {
  name: "",
  data() {
    return {
        text:'',
        tel:'',
    };
  },
  mounted() {},
  methods: {
    backTo() {
      this.$router.back();
    },
   async submit(){
    if(this.text==''&&this.tel==''){
        Toast('请填写内容')
    }else{
        let a=await  submitAction({
        content:this.text,
        phone:this.tel,
        name:localStorage.getItem('nickName'),
        openId:localStorage.getItem('openId')
     })
     console.log(a);
    }
    
    }
  },
};
</script>

<style lang="scss" scoped>
.header {
  background-color: #fff;
  .header-box {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;

    .header-l {
      width: 95px;
      height: 44px;
    }

    .header-m {
      height: 50px;
      margin-right: 10%;
      font-size: 36px;
      color: #333333;
      letter-spacing: 0;
      font-weight: 500;
    }
  }
}
.top {
  margin: 0 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  .txt-t {
    width: 710px;
    height: 284px;
    border-style: none;
  }
}

.txt-b {
  width: 710px;
  height: 100px;
  border-style: none;
}
.btn {
  position: fixed;
  bottom: 0;
  left: 20px;
  width: 710px;
  height: 90px;
  border-style: none;
  background: #cea62a;
  border-radius: 44.5px;
  color: #fff;
}
</style>>